#include "stdafx.h"
#include "Global.h"

using namespace MomogenkyouContent;
SmartPtr<MomogenkyouContent::LoadingIndicator>	Global::g_pLoadingIndicator(NULL);
SmartPtr<MomogenkyouContent::SplashScreen>		Global::g_pSplashScreen(NULL);
SmartPtr<MomogenkyouContent::MainMenuScreen>	Global::g_pMainMenuScreen(NULL);


bool	Global::InitializeGlobalContents()
{
	WriteCommandLine("> Content >> InitializeGlobal");
	
	MomogenkyouContent::CommonContents::Initialize();
	//	User Interfface
	{
		g_pLoadingIndicator	=	SmartPtr<MomogenkyouContent::LoadingIndicator>(new MomogenkyouContent::LoadingIndicator);
		g_pSplashScreen		=	SmartPtr<MomogenkyouContent::SplashScreen>(new MomogenkyouContent::SplashScreen);
		g_pMainMenuScreen	=	SmartPtr<MomogenkyouContent::MainMenuScreen>(new MomogenkyouContent::MainMenuScreen);


		MomogenkyouSystem::ScreenManager::Initialize();
		MomogenkyouSystem::ScreenManager::AddScreen(Global::SplashScreen());
	}

	return true;
}

bool	Global::ShutdownGlobalContents()
{
	WriteCommandLine("> Content >> ShutdownGlobal");
	//	User Interfface
	{
		MomogenkyouSystem::ScreenManager::Shutdown();

		g_pSplashScreen.reset(NULL);
		g_pSplashScreen.release();

		g_pMainMenuScreen.reset(NULL);
		g_pMainMenuScreen.release();


		MomogenkyouContent::CommonContents::Shutdown();

	}

	return true;
}
